package com.twu.biblioteca.IO;

import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * User: haruo
 * Date: 5/27/13
 */
public class IoHandler implements IoInterface {
    private PrintStream output;
    private InputStream input;
    private Scanner scan;

    public IoHandler() {
        this.input = System.in;
        this.output = System.out;
    }

    public IoHandler(PrintStream printStream, InputStream inputStream) {
        this.output = printStream;
        this.input = inputStream;
    }

    @Override
    public void print(String message) {
        output.print(message);
    }

    @Override
    public String getInput() {
        scan = new Scanner(this.input);
        return scan.nextLine();
    }
}
